<template>
    <div class="student">    
        <h1>学生{{name}}{{address}}</h1>
        <button @click="studentClick">调用APP</button>
    </div>
</template>

<script>
    export default {
        name:"MySchool",
        data(){
            return {
                name:'zzz1',
                address:"zzzzzzzzfffffff"
            }
        },
        methods:{
            studentClick(){
                // 向父组件调用v-on绑定的事件
                this.$emit("studentClick",this.name)
            }
        }
    }
</script>

<style scoped lang="less">
    .student{
        background-color: skyblue;
    }
</style>
